home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 41 / Amiga Format CD41 (1999-06)(Future Publishing)(GB)[!][issue 1999-07].iso / -seriously_amiga- / comms / other / queso / queso.amirx < prev    next >
Text File  |  1999-04-19  |  1KB  |  70 lines

  1. /* queso,amirx 1.0 (29.3.1999) by alfie
  2.  
  3.    Based on queso.amirx/0.1 by poing
  4.  
  5.    Usage: /rx queso [nickname] [port/N]
  6.           Otherwise:
  7.           /alias queso /rx queso %p
  8.           and then just
  9.           /queso nickname
  10.  
  11.           If no nickname given, it gets the selected user, if any
  12.  
  13.           Can be call in the form
  14.           /rx queso.amirx port/N
  15.           to specified a port an get the selected user, if any
  16. */
  17.  
  18. /*** SET THIS PATH TO A COMPLETE PATH TO queso !!! */
  19. cmdPath="inet:bin/queso"
  20.  
  21. signal on syntax
  22. options results
  23. prgName="queso"
  24.  
  25. parse arg user port .
  26.  
  27. "ISCONNECTED"
  28. if rc~=0 then call ircErr "Not connected."
  29.  
  30. if user="" | DataType(user,"N") then do
  31.     "GETCHANNEL"
  32.     ch=result
  33.     "GETSELECTEDUSER CHANNEL" ch
  34.     if rc~=0 then call ircErr "No user selected."
  35.     if port="" then port=user
  36.     user=result
  37. end
  38. if port="" then port=113
  39. if port<1 | port>65535 then call ircErr "bad value port '"port"'."
  40.  
  41. "USERHOST" user
  42. if rc~=0 then call ircErr "User '"user"' not found."
  43. parse var result d"@"host
  44.  
  45. call ircInfo "Checking '"user"' ["host":"port"]..."
  46. file="pipe:queso."pragma("ID")
  47. cmd="run" cmdPath ">"file host':'port
  48. address command cmd
  49.  
  50. if rc~=0 then call ircErr "queso failed."
  51. if ~Open(fp,file,"R") then call ircErr "can't open pipe:"
  52. do while ~eof(fp)
  53.     line = ReadLN(fp)
  54.     if line~="" then call ircInfo line
  55. end
  56. exit
  57.  
  58. ircInfo:
  59. parse arg msg
  60.     "echo P="d2c(27)"b«"prgName"» C=6" msg
  61.     return
  62.  
  63. ircErr:
  64. parse arg msg
  65.     call ircInfo msg
  66.     exit
  67.  
  68. syntax:
  69.     call ircErr "Syntax error:"ErrorText(rc) "in line:"sigl
  70.